package com.ljw.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lijunwei
 * @date 2025/5/21
 */
public class DateUtils {

    public static Date stringToDate(String time) {

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date parse;
        try {

            parse = simpleDateFormat.parse(time);

        } catch (ParseException e) {

            throw new RuntimeException("时间转换异常", e);

        }

        return parse;

    }
}
